package com.xbb.entity;

import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.xbb.entity.User;
import com.xbb.entity.Commodity;

public class CommodityOrders{

    private static final long serialVersionUID = 1L;

    //  兑换订单ID
    private Integer id;

    //  兑换时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date creatTime;

    //  用户ID
    private Integer userId;

    //  订单状态
    private Integer status;

    //  订单编号
    private String number;

    //  兑换者
    private String name;

    //  联系方式
    private String cellphone;

    //  地址
    private String address;

    //  日期
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date creatDate;

    //  年份
    private Integer year;

    //  月份
    private Integer month;

    //  产品ID
    private Integer commodityId;

    //  兑换数量
    private Integer quantity;

    //  合计金额
    private Double money;

    //  耗费积分
    private Integer integrate;

    private User user;

    private Commodity commodity;

    public void setId(Integer id){
        this.id = id;
    }

    public Integer getId(){
        return id;
    }

    public void setCreatTime(Date creatTime){
        this.creatTime = creatTime;
    }

    public Date getCreatTime(){
        return creatTime;
    }

    public void setUserId(Integer userId){
        this.userId = userId;
    }

    public Integer getUserId(){
        return userId;
    }

    public void setStatus(Integer status){
        this.status = status;
    }

    public Integer getStatus(){
        return status;
    }

    public void setNumber(String number){
        this.number = number;
    }

    public String getNumber(){
        return number;
    }

    public void setName(String name){
        this.name = name;
    }

    public String getName(){
        return name;
    }

    public void setCellphone(String cellphone){
        this.cellphone = cellphone;
    }

    public String getCellphone(){
        return cellphone;
    }

    public void setAddress(String address){
        this.address = address;
    }

    public String getAddress(){
        return address;
    }

    public void setCreatDate(Date creatDate){
        this.creatDate = creatDate;
    }

    public Date getCreatDate(){
        return creatDate;
    }

    public void setYear(Integer year){
        this.year = year;
    }

    public Integer getYear(){
        return year;
    }

    public void setMonth(Integer month){
        this.month = month;
    }

    public Integer getMonth(){
        return month;
    }

    public void setCommodityId(Integer commodityId){
        this.commodityId = commodityId;
    }

    public Integer getCommodityId(){
        return commodityId;
    }

    public void setQuantity(Integer quantity){
        this.quantity = quantity;
    }

    public Integer getQuantity(){
        return quantity;
    }

    public void setMoney(Double money){
        this.money = money;
    }

    public Double getMoney(){
        return money;
    }

    public void setIntegrate(Integer integrate){
        this.integrate = integrate;
    }

    public Integer getIntegrate(){
        return integrate;
    }

    public User getUser(){
        return user;
    }

    public void setUser(User user){
        this.user = user;
    }

    public Commodity getCommodity(){
        return commodity;
    }

    public void setCommodity(Commodity commodity){
        this.commodity = commodity;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("creatTime", getCreatTime())
                .append("userId", getUserId())
                .append("status", getStatus())
                .append("number", getNumber())
                .append("name", getName())
                .append("cellphone", getCellphone())
                .append("address", getAddress())
                .append("creatDate", getCreatDate())
                .append("year", getYear())
                .append("month", getMonth())
                .append("commodityId", getCommodityId())
                .append("quantity", getQuantity())
                .append("money", getMoney())
                .append("integrate", getIntegrate())
                .toString();
    }
}
